#define _CRT_SECURE_NO_WARNINGS

#include "SeqList.h"

void testSLList()
{
	SL s;
	SL_Init(&s);

	SL_PushBack(&s, 1);
	SL_PushBack(&s, 2);
	SL_PushBack(&s, 3);
	SL_PushBack(&s, 4);
	SL_PushBack(&s, 5);
	SL_PushBack(&s, 6);
	SL_PushBack(&s, 7);
	SL_PushBack(&s, 8);
	SL_Print(&s);

	SL_Insert(&s, 4, 23);
	SL_Print(&s);
	SL_Insert(&s, 2, 123);
	SL_Print(&s);

	SL_PushFront(&s, -45);
	SL_Print(&s);

	SL_PopFront(&s);
	SL_PopFront(&s);
	SL_PopFront(&s);
	SL_PopFront(&s);
	SL_PopFront(&s);
	SL_PopFront(&s);

	SL_PushFront(&s, -15);
	SL_Print(&s);

	SL_PopBack(&s);
	SL_Print(&s);

	SL_Erase(&s, 2);
	SL_Print(&s);

	SL_PopFront(&s);
	SL_Print(&s);

}

void testSLList2()
{
	SL s;
	SL_Init(&s);

	SL_PushBack(&s, 11);
	SL_PushBack(&s, 2);
	SL_PushBack(&s, 31);
	SL_PushBack(&s, 43);
	SL_PushBack(&s, 56);
	SL_Print(&s);
	SL_Insert(&s, 2, 256);
	SL_Print(&s);

	int pos = SL_Find(&s, 43);
	if (pos != -1)
		SL_Erase(&s, pos);
	SL_Print(&s);

	pos = SL_Find(&s, 31);
	SL_Modify(&s, pos, 888);
	SL_Print(&s);

}
int main()
{
	testSLList2();
	return 0;
}